import Counter from '../components/Counter';
import { connect } from 'react-redux';

import {
  createIncrementAction,
  createDecrementAction,
  createIncrementAsyncAction,
} from '../redux/countAction';

// eslint-disable-next-line react-refresh/only-export-components
export default connect(
  state => ({
    count: state,
  }),
  // 自动分发action
  {
    increment: createIncrementAction,
    decrement: createDecrementAction,
    incrementAsync: createIncrementAsyncAction,
  },
)(Counter);
